// 全封装函数写和渲染页面
const {getTop250Http} = require("../../utils/top-htp")
Page({
   data:{
       movies:[]
   },
   onLoad(){
       wx.showLoading({
           title:"数据正在加载中"
       });
       getTop250Http().then(res=>{
           wx.hideLoading();
           this.handleTop250HttpData(res)
       })
   },
   handleTop250HttpData(res){
    //   console.log(res.data.res)
      this.setData({
          movies:res.data.res
      })
   },
   handleItem(event){
       var {aid} = event.currentTarget.dataset;
       wx.navigateTo({
           url: `/pages/detail/detail?id=${aid}`
       });
   }
})